﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COC.Tools.AI.Motion;
using UnityEngine;

namespace COC.Character.AI.Internal.FSM
{
    public abstract class IFSMStack
    {

        protected internal Stack<AiAction> enterStack = new Stack<AiAction>();
        public virtual void pushSingleState(AiAction state) { }
        public virtual AiAction popState() { return null; }
        public virtual AiAction getCurrState() { return null; }
        public virtual List<FSMState> getAllStates() { return null; }
        public virtual int cleanStates() { return 0; }
        public virtual Stack<AiAction> getStack() { return enterStack; } 

    }
    /// <summary>
    /// we group a compounded action which including ai's flag,steering behavior,and animation clip,in order to bunch of these dependency each one when perform a state function of stack. 
    /// </summary>

    public class AiAction
    {
       protected internal object state;
       public float time;
       protected internal Func<IEnumerator> enterState = FSMConnector.DoNothing;
       protected internal Func<IEnumerator> exitState = FSMConnector.DoNothing;

        
    }

  /*  /// <summary>
    /// list of built-in flags within character.
    /// </summary>
    [Flags]
    public enum FSMState
    {
        NONE = (1 << 0),
        SEEK = (1 << OFFSET),
        FOLLOW_PATH = (1 << OFFSET + 1),
        QUEUE = (1 << OFFSET + 2),
        WANDER = (1 << OFFSET + 3),
        FLEE = (1 << OFFSET + 4),
        COHESION = (1 << OFFSET + 5),
        SEPARATION = (1 << OFFSET + 6),
        COLLISION_AVOIDANCE = (1 << OFFSET + 7),
        ATTACK = (1 << OFFSET + 8),
        STANDBY = (1 << OFFSET + 9),
        DIED = (1 << OFFSET + 10),
        DEFEND = (1 << OFFSET + 11),
        OFFSET = 1
    }*/
}
